package com.mall.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mall.bean.Fadeback;
import com.mall.bean.FadebackExample;
import com.mall.dao.FadebackMapper;
import com.mall.service.FadebackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FadebackServiceImpl implements FadebackService {
    @Autowired
    FadebackMapper fadebackMapper;
    @Override
    public int insert(Fadeback fadeback) {
        return 0;
    }

    @Override
    public List<Fadeback> queryData(Fadeback fadeback) {
        return null;
    }

    @Override
    public int update(Fadeback fadeback) {

        return fadebackMapper.updateByPrimaryKeySelective(fadeback);
    }

    @Override
    public int deleteById(String id) {
        fadebackMapper.deleteByPrimaryKey(Integer.parseInt(id));
        return 0;
    }

    @Override
    public Fadeback queryDataById(String id) {
        return null;
    }

    @Override
    public PageInfo<Fadeback> queryDataByPage(int currentPage, int pageSize, Fadeback fadeback) {
        PageHelper.startPage(currentPage,pageSize);
        List<Fadeback> fadebackList = fadebackMapper.selectByDate(fadeback);
        PageInfo<Fadeback> fadebackPageInfo=new PageInfo<>(fadebackList);
        return fadebackPageInfo;
    }
}
